using System;
using System.Collections.Generic;
using System.Linq;

namespace RotateArray
{
    public class Solution
    {
        public void Rotate(int[] nums, int k)
        {
            var queue = new Queue<int>(nums.Reverse());

            for (var i = 0; i < k; i++) queue.Enqueue(queue.Dequeue());

            Array.Copy(queue.Reverse().ToArray(), nums, queue.Count);
        }
    }
}